package com.ostrich.cloud.ostrichUserService.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ostrich.cloud.common.result.PageResult;
import com.ostrich.cloud.ostrichUserService.infra.model.Customer;
import com.ostrich.cloud.ostrichUserService.infra.model.UserParent;
import com.ostrich.ostrichUserService.dto.CustomerDto;
import com.ostrich.ostrichUserService.param.CusPasswordParam;
import com.ostrich.ostrichUserService.param.LoginCusParam;
import com.ostrich.ostrichUserService.param.RegCustomerParam;
import com.ostrich.ostrichUserService.param.UpdateCusParam;
import io.seata.core.exception.TransactionException;

import java.math.BigDecimal;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author Lucas
 * @since 2022-10-26
 */
public interface CustomerService extends IService<Customer> {

    void Register(RegCustomerParam regCustomerParam);

    void updateCusMessage(Customer customer);

    PageResult<CustomerDto> getAllCusMessage(Integer current, Integer sizem, String status);

    UserParent customerLogin(LoginCusParam loginCusParam);

    void updatePassword(CusPasswordParam cusPasswordParam);

    void upCusStatus(Integer parentId,String status);

    void pay(Integer parentId, String total_amount) throws TransactionException;

    /**
     * 扣减余额
     * @param parentId
     * @param price
     */
    void reduce(Integer parentId, BigDecimal price) throws TransactionException;

}
